import request from '@/utils/request'

// https://api.wuliuren.com/api/suppliers 供应商列表
export function suppliersList(data) {
  return request({
    url: 'admin/articles',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/suppliers 添加供应商
export function addSuppliers(data) {
  return request({
    url: 'admin/articles',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/suppliers 编辑供应商
export function editSuppliers(data) {
  return request({
    url: 'admin/articles/' + data.id,
    method: 'put',
    data: data
  })
}

// https://api.wuliuren.com/api/suppliers 删除供应商
export function delSuppliers(data) {
  return request({
    url: 'admin/articles/' + data.id,
    method: 'delete'
  })
}



// https://api.wuliuren.com/api/supplier-categories 供应商分类列表
export function suppliersCategoriesList(data) {
  return request({
    url: 'admin/article-categories',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/supplier-categories 新增供应商分类列表
export function addSuppliersCategoriesList(data) {
  return request({
    url: 'admin/article-categories',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/supplier-categories 编辑供应商分类列表
export function editSuppliersCategories(data) {
  return request({
    url: 'admin/article-categories/' + data.id,
    method: 'PUT',
    data: data
  })
}

// https://api.wuliuren.com/api/supplier-categories 删除供应商分类列表
export function delSuppliersCategories(data) {
  return request({
    url: 'admin/article-categories/' + data.id,
    method: 'DELETE'
  })
}

// https://api.wuliuren.com/api/supplier-sources 供应商来源列表
export function suppliersSourcesList(data) {
  return request({
    url: 'supplier-sources',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/supplier-sources 添加供应商来源
export function addSuppliersSources(data) {
  return request({
    url: 'supplier-sources',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/supplier-sources 编辑供应商来源
export function editSuppliersSources(data) {
  return request({
    url: 'supplier-sources/' + data.id,
    method: 'PUT',
    data: data
  })
}

// https://api.wuliuren.com/api/supplier-sources 删除供应商来源
export function delSuppliersSources(data) {
  return request({
    url: 'supplier-sources/' + data.id,
    method: 'delete'
  })
}


// https://api.wuliuren.com/api/supplier-statuses 供应商状态列表
export function suppliersStatusesList(data) {
  return request({
    url: 'supplier-statuses',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/supplier-statuses 添加供应商状态
export function addSuppliersStatuses(data) {
  return request({
    url: 'supplier-statuses',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/supplier-statuses 编辑供应商状态
export function editSuppliersStatuses(data) {
  return request({
    url: 'supplier-statuses/' + data.id,
    method: 'put',
    data: data
  })
}

// https://api.wuliuren.com/api/supplier-statuses 删除供应商状态
export function delSuppliersStatuses(data) {
  return request({
    url: 'supplier-statuses/' + data.id,
    method: 'delete'
  })
}


// https://api.wuliuren.com/api/customer-contacts 联系人列表
export function getContactsList(data) {
  return request({
    url: 'supplier-contacts',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customer-contacts 添加联系人
export function addContacts(data) {
  return request({
    url: 'supplier-contacts',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-contacts 编辑联系人
export function editContacts(data) {
  return request({
    url: 'supplier-contacts/'+data.id,
    method: 'put',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-contacts 删除联系人
export function delContacts(data) {
  return request({
    url: 'supplier-contacts/'+data.id,
    method: 'delete',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 开票资料列表
export function invoiceSubjects(data) {
  return request({
    url: '/supplier-invoice-subjects',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 新增开票资料
export function addInvoiceSubjects(data) {
  return request({
    url: '/supplier-invoice-subjects',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 编辑开票资料
export function editInvoiceSubjects(data) {
  return request({
    url: '/supplier-invoice-subjects/' + data.id,
    method: 'put',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 删除开票资料
export function delInvoiceSubjects(data) {
  return request({
    url: '/supplier-invoice-subjects/' + data.id,
    method: 'delete'
  })
}
